import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class EchoWidgetPage extends StatelessWidget {
  const EchoWidgetPage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
            title: Text(title)),
      body: EchoWidget(textCenter: "hello world",),
    );
  }
}

class EchoWidget extends StatelessWidget{
  EchoWidget({
    Key key,
    this.textCenter,
    this.backgroundColor:Colors.blueAccent
  }):super(key:key);
  final String textCenter;
  final Color backgroundColor;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        color: backgroundColor,
        child: Text(textCenter)
      )
    );
  }
}